package com.sc3.game.logic;

import java.sql.Connection;

import com.sc3.game.dataaccess.UserDA;
import com.sc3.game.serverbean.UserBean;

public class UserLogic {
	public static UserBean register(String email, String name, String password) {
		Connection connection = LogicUtil.createConnection();
		try {
			return UserDA.register(connection, email, name, password);
		} catch (Exception e) {
			e.printStackTrace();
		} finally {
			LogicUtil.closeConnection(connection);
		}
		return null;
	}
	
	public static UserBean login(String email, String password){
		Connection connection = LogicUtil.createConnection();
		try {
			return UserDA.login(connection, email, password);
		} catch (Exception e) {
			e.printStackTrace();
		} finally {
			LogicUtil.closeConnection(connection);
		}
		return null;
	}

	
}
